import React from 'react';
import PropTypes from 'prop-types';
import { Table } from 'antd';

// render file list
const TMTable = ({ onRow, columns, dataSource,scroll,rowSelection }) => (
  <Table
    rowKey={record => record.id}
    scroll={scroll}
    rowSelection={rowSelection}
    style={{ marginTop: 20, cursor: 'text' }}
    columns={columns}
    dataSource={dataSource}
    pagination={true}
    locale={{ emptyText:'暂无内容'}}
  />
);

TMTable.defaultProps = {
  // onRow: () => {},
};

TMTable.propTypes = {
  columns: PropTypes.array.isRequired,
  dataSource: PropTypes.array.isRequired,
};

export default TMTable;
